"""
产品管理相关的数据模型
"""

from pydantic import BaseModel
from typing import Optional, Dict, Any


class ProductCreateRequest(BaseModel):
    """创建产品请求模型"""
    name: str
    description: Optional[str] = None
    unit_amount: int  # 价格（以分为单位）
    currency: str = "usd"
    interval: str = "month"  # month, year
    interval_count: int = 1
    metadata: Optional[Dict[str, str]] = None


class ProductUpdateRequest(BaseModel):
    """更新产品请求模型"""
    name: Optional[str] = None
    description: Optional[str] = None
    metadata: Optional[Dict[str, str]] = None


class ProductResponse(BaseModel):
    """产品响应模型"""
    id: str
    stripe_product_id: str
    stripe_price_id: str
    name: str
    description: Optional[str] = None
    unit_amount: int
    currency: str
    interval: str
    interval_count: int
    metadata: Dict[str, str]
    created_at: str
    updated_at: str
    is_active: bool
